package com.probiz.estore.customer.service;

import java.util.List;

import com.probiz.estore.common.model.customer.Address;
import com.probiz.estore.core.service.GenericManager;

public interface AddressManager extends GenericManager<Address> {
	/**
	 * 获得客户所有地址
	 * @param appuserId
	 * @return
	 */
	public List<Address> getAllByAppuserId(Integer appuserId);

	/**
	 * 获取默认的运输地址
	 * 
	 * @param appuserId
	 * @return
	 */
	public Address getDefShippingAddr(Integer appuserId);

	/**
	 * 设置默认的运输地址
	 * 
	 * @param appuserId
	 * @param addressId       如果为空则取第一个设置为默认
	 * @return
	 */
	public Address updateDefShippingAddr(Integer appuserId, Integer addressId);
	/**
	 * 获得客户所有送货地址
	 * @param appuserId
	 * @return
	 */
	public List<Address> getAllShippingAddressByAppuserId(Integer appuserId);
	/**
	 * 完全保存方法
	 * @param address
	 */
	public void saveFully(Address address);

	/**
	 * 获得客户收货人地址的个数
	 * 
	 * @param customerId
	 * @return
	 */
	public Long countAddressOfCustomer(Integer customerId);
}
